/**
 * 
 */
package org.vsg.stock.core.persistence.mybatis;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Vector;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.dao.DataAccessException;
import org.vsg.stock.core.domain.ExRights;
import org.vsg.stock.core.persistence.ExRightsDao;

/**
 * @author vison
 *
 */
public class ExRightsDaoImpl extends SqlSessionDaoSupport  implements ExRightsDao {

	/* (non-Javadoc)
	 * @see org.vsg.stock.basic.persistence.StockDailyLineDao#saveAll(java.util.Collection)
	 */
	@Override
	public void saveAll(Collection<ExRights> domains)
			throws DataAccessException {
		// TODO Auto-generated method stub
		for (ExRights exrights : domains) {
			getSqlSessionTemplate().insert("org.vsg.stock.core.domain.mybatis.ExRightsProxy.insertExRights", exrights);
		}
		logger.debug("insert entity " );
	}

	@Override
	public List<ExRights> findAll() throws DataAccessException {
		List result = this.getSqlSessionTemplate().selectList(
				"org.vsg.stock.core.domain.mybatis.ExRightsProxy.findAllExrights"
			);
		return (List<ExRights>)result;
	}

	@Override
	public List<String> findExtRightKey() throws DataAccessException {
		// TODO Auto-generated method stub
		List<String> keyList = new Vector<String>();
		
		keyList = this.getSqlSessionTemplate().selectList("org.vsg.stock.core.domain.mybatis.ExRightsProxy.findExtRightsKey");

		return keyList;
	}




	

}
